package com.matrix.java.chap_05.example;

import java.util.Scanner;

public class Case5_04 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int countRight = 0;
        int count = 0;
        while (count<5){
            int num1 = (int) (Math.random()*10);
            int num2 = (int) (Math.random()*10);
            int divide = num1-num2;
            System.out.print(num1+"-"+num2+"=？");
            int calNum = input.nextInt();
            if (divide==calNum){
                countRight+=1;
            }
            count+=1;
        }
        System.out.println(countRight);
        input.close();
    }
}
